<?php

namespace think\wework\Api;

use think\wework\Abstracts\WeworkApiWithTokenAndCache;

class Ticket extends WeworkApiWithTokenAndCache
{
    /**
     * @return string
     */
    protected function getCacheKey(): string
    {
        return md5('wework.api.ticket');
    }

    /**
     * @return string
     */
    protected function getFromServer(): string
    {
        $query = ['type' => 'wx_card'];
        $data = $this->httpClient->get('ticket/get', compact('query'))->toArray();

        return $data['ticket'];
    }
}
